package com.rongxun.hbwallet.ui.activities;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.rongxun.base.MvpActivity;
import com.rongxun.hbwallet.R;
import com.rongxun.hbwallet.mvp.contract.IWalletManager;
import com.rongxun.hbwallet.mvp.presenter.WalletManagerPresenter;
import com.rongxun.utils.ActivityUtils;
import com.rongxun.utils.StatusBarUtil;
import com.rongxun.utils.wallet.ETHWallet;

import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 创建者     庄丰泽
 * 创建时间   2018/8/8 14:56
 * 描述	      钱包管理
 */

public class WalletManagerActivity extends MvpActivity<IWalletManager.IView, WalletManagerPresenter> implements IWalletManager.IView {
    @BindView(R.id.toolbar_back)
    ImageView mToolbarBack;
    @BindView(R.id.toolbar_title)
    TextView  mToolbarTitle;
    @BindView(R.id.toolbar)
    Toolbar   mToolbar;
    @BindView(R.id.walletmanager_btn_createwallet)
    Button    mWalletmanagerBtnCreatewallet;
    @BindView(R.id.walletmanager_btn_importwallet)
    Button    mWalletmanagerBtnImportwallet;

    @Override
    public Context getContext() {
        return this;
    }

    @Override
    public void showLoading(boolean show) {

    }

    @Override
    public void showError(String msg, String errorCode) {

    }

    @Override
    public void checkPermissionsSuccessful(String... permissions) {

    }

    @Override
    public void release() {

    }

    @NonNull
    @Override
    public WalletManagerPresenter createPresenter() {
        return new WalletManagerPresenter(this);
    }

    @Override
    public void showWalletList(List<ETHWallet> ethWallets) {

    }

    @Override
    protected void init() {
        StatusBarUtil.setToolBarPaddingTop(mToolbar, this);
        mToolbarTitle.setText(getString(R.string.wallet_manager));
        mToolbarBack.setVisibility(View.VISIBLE);
    }

    @Override
    protected int getContentView() {
        return R.layout.activity_walletmanager;
    }

    @OnClick({R.id.toolbar_back, R.id.walletmanager_btn_createwallet, R.id.walletmanager_btn_importwallet})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.toolbar_back:
                onBackPressed();
                break;
            case R.id.walletmanager_btn_createwallet:
                ActivityUtils.startActivityWithAnimotion(this, new Intent(this, CreateWalletActivity.class));
                break;
            case R.id.walletmanager_btn_importwallet:
                ActivityUtils.startActivityWithAnimotion(this, new Intent(this, LoadWalletActivity.class));
                break;
        }
        finish();
    }

}